package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.Award;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("awardService")
public class AwardServiceImpl implements ServiceTemplateInterface<Award> {
	
	private DaoTemplateInterface<Award> awardDao;
	
	public DaoTemplateInterface<Award> getAwardDao() {
		return awardDao;
	}
	@Resource(name="awardDao")
	public void setAwardDao(DaoTemplateInterface<Award> awardDao) {
		this.awardDao = awardDao;
	}

	public void add(Award t) throws RunException {
		awardDao.save(t);
	}

	public void removeById(long id) throws RunException {
		awardDao.deleteById(id);
	}

	public void remove(Award t) throws RunException {
		awardDao.delete(t);
	}

	public long update(Award t) throws RunException {
		return awardDao.update(t);
	}

	public Award getById(long id) throws RunException {
		return awardDao.loadById(id);
	}

	public List<Award> getAll() throws RunException {
		return awardDao.loadAll();
	}

}
